using System;
using System.Collections.Generic;
using System.Linq;

namespace Behaving.Composites
{
    public abstract class Composite : Behaviour, IHasChildren
    {
        protected Composite(params Behaviour[] children)
        {
            Children = children.Where(x => x != null).ToList();
        }

        public List<Behaviour> Children { get; set; }      
        
        public IEnumerable<Behaviour> GetChildren()
        {
            return Children;
        }
    }
}